using pub.CmdUI.Cmd;
using pub.CmdUI.UI.Control;

namespace todo.Cmd.Edit.TodoAttr
{
    public class CheckCmd : DefaultCmd, ICmdState
    {
        bool? ICmdState.Checked
        {
            get
            {
                //
                return TodoApi.Instance.IsActiveTodoChecked;
            }
        }

        bool ICmdState.Enabled
        {
            get { return TodoApi.Instance.ActiveTodo != null; }
        }

        public override void Execute(IControlUI controlUi)
        {
            TodoApi.Instance.ToggleChecked();
        }
    }
}